<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%
    String path = request.getContextPath(); 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+path+ "/"; 
     
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    <style type="text/css">
    a{ text-decoration:none} 
    </style>
        <meta charset="utf-8">
        <base href="<%=basePath%>">
        <title>
                            用户详情
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="css/x-admin.css" media="all">
    </head>
    
    <body>
       <fieldset class="layui-elem-field">
				  <legend>用户基本信息</legend>
				  <div class="layui-field-box">
				      <form class="layui-form layui-form-pane" action="">
				          <input type="hidden" id="gId" value="${user.gId}">
				          <div class="layui-form-item">
						      <label style="font-size: 16px">&nbsp;&nbsp;&nbsp;&nbsp;头像：</label>  
						      <img alt="" src="${user.gUserAvatar}" style="width: 50px;height: 50px; border-radius: 45px;">
						 
						  </div>
						  <div class="layui-form-item">
						    <label class="layui-form-label">昵称</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="订单号" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserName}">
						    </div>
						  </div>
						  <div class="layui-form-item">
						    <label class="layui-form-label">手机号</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="暂未支付" autocomplete="off" class="layui-input" disabled="disabled" value="${details.gUserPhone}">
						    </div>
						  </div>
						  
						   <div class="layui-form-item">
						    <label class="layui-form-label">性别</label>
						    <div class="layui-input-inline">
						      <c:if test="${user.gUserSex==1}">
						          <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="男">
						      </c:if>
						      <c:if test="${user.gUserSex==2}">
						          <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="女">
						      </c:if>
						      <c:if test="${user.gUserSex==3}">
						          <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="保密">
						      </c:if>
						    </div>
						  </div>

						  <div class="layui-form-item">
						    <label class="layui-form-label">出生日期</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="暂未支付" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserBirthday}">
						    </div>
						  </div>
						  
						  <div class="layui-form-item">
						    <label class="layui-form-label">所在地</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserAddress}">
						    </div>
						  </div>
						  
						  <div class="layui-form-item">
						    <label class="layui-form-label">积分</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserIntegral}">
						    </div>
						  </div>
						  
						  <div class="layui-form-item">
						    <label class="layui-form-label">成长值</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserGrow}">
						    </div>
						  </div>
						  
						   <div class="layui-form-item">
						    <label class="layui-form-label">注册时间</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="暂未支付" autocomplete="off" class="layui-input" disabled="disabled" value='<fmt:formatDate value="${user.gUserCreateTime}"/>'>
						    </div>
						  </div>
                  </form>
				  </div>
      </fieldset>
      
      
            <fieldset class="layui-elem-field">
				  <legend>其他信息</legend>
				  <div class="layui-field-box">
				      <form class="layui-form layui-form-pane" action="">
						<div class="layui-form-item">
						    <label class="layui-form-label">用户学校</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserSchool}">
						    </div>
						  </div>
						  
						 <div class="layui-form-item">
						    <label class="layui-form-label">用户专业</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserEducation}">
						    </div>
						  </div> 
						  
						  <div class="layui-form-item">
						    <label class="layui-form-label">学历</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserProfession}">
						    </div>
						  </div> 
						  
						  <div class="layui-form-item">
						    <label class="layui-form-label">毕业时间</label>
						    <div class="layui-input-inline">
						      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" disabled="disabled" value="${user.gUserGraduateTime}">
						    </div>
						  </div>			
                  </form>
                     <div class="layui-form-item">
	                     <label for="L_repass" class="layui-form-label">
	                     </label>
		                  <button  class="layui-btn" onclick="parent.location.reload()">
		                                                                        关闭
		                 </button>
		                 <c:if test="${user.gStatus==1}">
			                 <button  class="layui-btn" onclick="upStatus(2)" >
			                                                                         封号
			                 </button>
			             </c:if>
			             
			             <c:if test="${user.gStatus==2}">
			                 <button  class="layui-btn" onclick="upStatus(1)" >
			                                                                        解封
			                 </button>
			             </c:if>
                    </div>
				  </div>
      </fieldset>
        <script src="js/jquery-3.2.1.min.js"></script>
        <script src="lib/layui/layui.js" charset="utf-8">
        </script>
        <script src="js/x-layui.js" charset="utf-8">
      
        </script>
        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
 
            });
            
        </script>
        <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
        
        
      //解封号
        function upStatus(type) {
    	    var gId = $("#gId").val();
    		layer.confirm('确认要更改吗？',function(index){
                //发异步删除数据
    			$.ajax({
    			    type:"get",
    				url:"user/updateStatus",
    				data:{gId:gId,type:type
    					},
    				success:function(data){
    					 //console.log(data)
    				 	if(data.code==200){
    				 		layer.msg('操作成功!',{icon:3,time:3000});	
    				 		parent.location.reload()
    				           //window.location.href="jsp/advertisingManager/parentAdvertisingList.jsp";
    				 		}else {
    				 			layer.msg('操作失败!',{icon:3,time:3000});	
    				 		}
    				 	} 
    	  		 });
            });
    	}
        </script>
    </body>


</html>